from django.contrib import admin

# Register your models here.
from .models import *

#注册该模型
@admin.register(Food_type)
class Food_typeAdmin(admin.ModelAdmin):
    # 列表页面显示字段
    list_display = ['food_type']

#注册该模型
@admin.register(Eat_Food)
class Eat_FoodAdmin(admin.ModelAdmin):
    # 列表页面显示字段
    list_display = ['img', 'food_name','food_number','food_money','food_sold','food_type']

    # # 食品类别
    # class Food_type(models.Model):
    #     # 食品类
    #     food_type = models.CharField(max_length=255)
    #
    # # 食品表
    # class Eat_Food(models.Model):
    #     # 食品图片,RichTextUploadingField上传类型
    #     img = RichTextUploadingField()
    #     # 食品名称,models.CharField字符串类型
    #     food_name = models.CharField(max_length=255)
    #     # 库存数量,models.IntegerField数字类型
    #     food_number = models.IntegerField(default=100)
    #     # 单价,models.IntegerField数字类型
    #     food_money = models.IntegerField(default=0)
    #     # 已售数量,models.IntegerField数字类型
    #     food_sold = models.IntegerField(default=0)
    #
    #     # 一对多连接食品类
    #     food_type = models.ForeignKey(Food_type, on_delete=models.CASCADE)